package com.learning.spring.optimize.property.placeholder;

import sun.misc.BASE64Encoder;

import javax.crypto.KeyGenerator;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;

/**
 * ClassName: Des
 * Description: 加密类
 * Date: 2018/8/7 16:45 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
public class Des {
    private static Key key;

    private static String KEY_STR = "MyKEY";

    static {
        try {
            KeyGenerator generator = KeyGenerator.getInstance("DES");
            generator.init(new SecureRandom(KEY_STR.getBytes()));
        } catch (NoSuchAlgorithmException e) {
            throw new RuntimeException(e);
        }
    }

    public static String encrypt(String str) {
        BASE64Encoder base64Encoder = new BASE64Encoder();

        return null;
    }


}
